package com.yadang.homework;

import java.util.*;

/**
 * @author: 亚当
 * @date: 2023年02月05日 18:12
 * @package: com.yadang.homework
 * @Description: 去重
 */
public class DeweightObj {
    public static void main(String[] args) {
        Student student = new Student();
        student.setPartyName("张三");
        student.setAdress("北京");
        student.setSixCode("123456");

        Student student1 = new Student();
        student1.setPartyName("李四");
        student1.setAdress("桑海");
        student1.setSixCode("123123");

        Student student2 = new Student();
        student2.setPartyName("张三");
        student2.setAdress("北京");
        student2.setSixCode("123456");

        Student student3 = new Student();
        student3.setPartyName("");
        student3.setAdress("天津");
        student3.setSixCode("555555");

        ArrayList<Student> list = new ArrayList<>();
        list.add(student);
        list.add(student3);
        list.add(student1);
        list.add(student2);

        HashMap<Integer, Object> map = new HashMap<>();
        for (int i = 0; i < list.size(); i++) {
            Student stu = list.get(i);
            String partyName = stu.getPartyName();
            map.put(i, partyName); //每一行数据
        }
        List<String> value = FromValueToKeyUtil.getValue(map);
        if (value.size() != 0){  // 等于0说明没有重复的数据
            // 移除List集合中的重复的一行
            for (int i = 0; i < value.size(); i++) {
                String s = value.get(i);
            }
        }
        System.out.println(value);
    }

    private static String getDeweight(HashMap<Integer, Object> map) {

        Collection<Object> values = map.values();
        return null;
    }

}

